//
//  ZipViewController.swift
//  testRxSwift
//
//  Created by 火星人 on 2017/7/25.
//  Copyright © 2017年 火星人. All rights reserved.
//

import UIKit
import RxSwift

class ZipViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.addTapWithHandle { (tap) in
            
            let disBag = DisposeBag()
            
            let subjectString = PublishSubject<String>()
            let subjectInt = PublishSubject<Int>()
            
            Observable.zip(subjectString, subjectInt)
                .subscribe({ (eve) in
                    print(eve)
                })
                .disposed(by: disBag)
            
            subjectString.onNext("111")
            subjectInt.onNext(7)
            subjectInt.onNext(8)
            subjectInt.onNext(9)
            
            subjectString.onNext("222")
            subjectString.onNext("333")
            subjectString.onNext("444")
            subjectString.onNext("555")
            
        }
    }

}
